﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CrossLine
{
    class Init
    {
        public static void init(string fileName)
        {
            ConstDate.stocks = ReadStockFile.readStockFile(fileName);
            if (ConstDate.stocks == null)
            {
                LogUtil.LogLine("请输入正确的文件地址：");
                init(Console.ReadLine());
            } 
            int count = ConstDate.stocks.Count;
            if (count > 0)
            {
                StringBuilder s = new StringBuilder();
                for (int i = 0; i < count; i++)
                {
                    s.Append(ConstDate.stocks[i]);
                    s.Append(",");
                }
                s.Append("sh000001");
                ConstDate.stocksStr = s.ToString();
            }
            else
            {
                LogUtil.LogLine("没有股票，"+ DateTime.Now);
            }
        }
        
    }
}
